#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import socket
import time

server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(("127.0.0.1", 2001))
server.listen(2)
conn, addr = server.accept()

while True:
    data = conn.recv(1024).decode("utf-8")
    print(data)
    if data == "exit": exit(3)
    conn.sendall("{}".format(time.time()).encode("utf-8"))

conn.close()
